<%--
  Created by IntelliJ IDEA.
  User: yangwu
  Date: 2021/8/30
  Time: 17:33
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录页面</title>
</head>
<body>
    <div align="center">
        <h2>小型进销系统</h2>
        <form action="/user/login" id="loginForm">
            用户名：<input type="text" id="userName" name="userName"><br><br>
            密&emsp;码：<input type="password" id="password" name="password"><br><br>
            <button type="button" onclick="formSubmit()">登录</button>
        </form>
    </div>
    <script src="/statics/js/jquery-2.1.0.min.js"></script>
    <script>
        if(${error!=null}){
            alert(${error})
        }
        function formSubmit(){
            var userName=$("#userName").val();
            var password=$("#password").val();
            if(userName==""){
                alert("用户名不能为空！");
                return;
            }
            if(password==""){
                alert("密码不能为空！");
                return;
            }
            $("#loginForm").submit();
        }
    </script>
</body>
</html>
